export default {
	getPageData(id) {
		let that = this
		that.$httpRequest.get({
			that: that,
			url: 'h5/getMessageDetail',
			params: {
				id
			},
			success: res => {
				if (res.code === that.$httpConfig.SUCCESS_CODE) {
					that.netData = res.data
				} else {
					that.$toast.alert({
						content: res.message,
						callback: result => {
							if (result.confirm) {
								uni.navigateBack({
									delta: 1
								})
							}
						}
					})
				}
			}
		})
	},
	//同意好友申请
	agreeFollowApply(){
		let that = this
		that.$httpRequest.request({
			that: that,
			url: 'h5/agreeFollowApply',
			params: {
				id:that.netData.followApplyId,
				replyContent:that.requestText
			},
			success: res => {
				if (res.code === that.$httpConfig.SUCCESS_CODE) {
					that.$toast.msg('已同意', {
					    icon: 1
					})
					setTimeout(()=>{
						uni.navigateBack({
							delta: 1
						})
					},500)
				}else{
					that.$toast.msg(res.message, {
					    icon: 1
					})
				}
			
			}
		})
	},
	//拒绝好友申请
	denyFollowApply(){
		let that = this
		that.$httpRequest.request({
			that: that,
			url: 'h5/denyFollowApply',
			params: {
				id:that.netData.followApplyId,
				replyContent:that.requestText
			},
			success: res => {
				if (res.code === that.$httpConfig.SUCCESS_CODE) {
					that.$toast.msg('已拒绝', {
					    icon: 1
					})
					setTimeout(()=>{
						uni.navigateBack({
							delta: 1
						})
					},500)
					
				}else{
					that.$toast.msg(res.message, {
					    icon: 1
					})
				}
			
			}
		})
	},
}